package org.trinity.netdisk.util;


import org.trinity.netdisk.enums.ResultCode;

public class ResponseWrapper {
    private final Integer code;
    private final String msg;
    private final Object data;

    public ResponseWrapper(ResultCode resultCode, Object data){
        this.code = resultCode.getCode();
        this.msg = resultCode.getMessage();
        this.data = data;
    }

    public ResponseWrapper(ResultCode resultCode){
        this.code = resultCode.getCode();
        this.msg = resultCode.getMessage();
        this.data = null;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public Object getData() {
        return data;
    }
}
